﻿using AspDotNet.Core6.WebApi.Models;
using Microsoft.AspNetCore.Mvc;

namespace AspDotNet.Core6.WebApi.Controllers
{
    [ApiController]
    [Produces("application/xml")]
    [Consumes("application/xml")]
    [Route("api/[controller]/[action]")]
    public class ReceiveAndSendXmlController : ControllerBase
    {
        [HttpGet]
        public object GetXml()
        {
            return new Person() { address = "", age = "", name = "", pet = new Pet() { name = "tom" } };
        }

        [HttpPost]
        [Produces("text/xml")]
        [Consumes("text/xml")]
        public object UpdateXml([FromBody] Person person)
        {
            return new Person();
        }
    }

}
